import abc
from typing import Iterator, Optional

from zkl_serialization import JsonValue

JobEssence = JsonValue


class JobsStore(abc.ABC):
    @abc.abstractmethod
    def save_job(self, job_id: Optional[str], job_essence: JobEssence) -> str:
        pass

    @abc.abstractmethod
    def load_job(self, job_id: str) -> JobEssence:
        pass

    @abc.abstractmethod
    def remove_job(self, job_id: str):
        pass

    @abc.abstractmethod
    def iter_jobs_id(self) -> Iterator[str]:
        pass
